<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>网络请求</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="../../../../assets/css/reset.css"/>

    <link rel="stylesheet" href="../../../../assets/css/examples.css"/>

</head>
<body>
<h1>
    网络请求（Request）
</h1>

<ul>
    <li>
        <a href="javascript:void(0)" id="get">get方式</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="post">post方式</a>
    </li>
</ul>

<script  src="../../../../../core/$$.js"></script>
<script  src="../../../../../core/libs/zepto/zepto.min.js"></script>
<script  src="../../../../../core/libs/zepto/selector.js"></script>
<script  src="../../../../../core/libs/zepto/touch.js"></script>
<script  src="../../../../../core/libs/underscore-min.js"></script>
<script  src="../../../../../core/libs/oop.js"></script>
<script  src="../../../../../core/extend/prototype.js"></script>
<script  src="../../../../../core/extend/function.js"></script>
<script  src="../../../../../core/native/platformAdapter.js"></script>
<script  src="../../../../../core/native/api.js"></script>
<script  src="../../../../../core/native/eventListener.js"></script>
<script  src="../../../classes/XX.js"></script>
<script  src="../../../classes/common.js"></script>
<script  src="../../../../config/url/dev.js"></script>

<script type="text/javascript">
    window.onerror = function (msg, url, line) {
        alert('- ' + msg + '\n- ' + url + '\n- ' + line);
        return true;
    }

    $('#get').on('tap', function () {
        $$.Native.get({
            url: 'http://api.k780.com:88/',
            data: {
                app: 'weather.today',
                weaid: '1',
                appkey: '10003',
                sign: 'b59bc3ef6191eb9f747dd4e83c99f2a4',
                format: 'json'
            },
            success: function (response) {
                alert(response);
            }
        });
    });

    $('#request').on('tap', function () {
        $$.Native.request({
            url: 'http://api.k780.com:88/',
            type :"get",
            data: {
                app: 'weather.today',
                weaid: '1',
                appkey: '10003',
                sign: 'b59bc3ef6191eb9f747dd4e83c99f2a4',
                format: 'json'
            },
            success: function (response) {
                alert(response);
            }
        });
    });

    $('#post').on('tap', function () {
        $$.Native.post({
            url: 'http://10.180.138.105:8080/fces/rest/smbp-esb',
            data: {
                app: 'weather.today',
                weaid: '2',
                appkey: '10003',
                sign: 'b59bc3ef6191eb9f747dd4e83c99f2a4',
                format: 'json'
            },
            success: function (response) {
                alert(response);
            }
        });
    });
</script>
</body>
</html>